const app = getApp();
Component({
  
    properties:{        
        markers: {
            type:Array,
            value:[]
        },
        locationMsg:{
            type:Object,
            value:{
                lognitude:'',
                latitude:''
            }
        }
    },
    data:{
       
        mapControls: [{   //地图中心
            id: 0,
            position: {                 //相对定位
                left: app.globalData.scWidth * 0.47,
                top: app.globalData.scHeight * 0.29,
                width: app.globalData.scHeight * 0.032,
                height: app.globalData.scHeight * 0.05

            },
            iconPath: "/images/d0.png",
            width: 30,
            height: 20,
            clickable: false
        }, {
            id: 1,
            position: {                 //相对定位
                left: app.globalData.scWidth * 0.00,
                top: app.globalData.scHeight * 0.35,
                width: app.globalData.scWidth * 0.15,
                height: app.globalData.scHeight * 0.091
            },
            iconPath: "/images/dw.png",          //相对于当前文件的路径
            clickable: true
        }
        ],
    },
    methods:{
        regionchange(e) {
            /** 中心点的位置 **/
            if (e.type == "end") {
                var that = this;
                console.log(that);
                this.mapCtx.getCenterLocation({
                    success: (res) => {
                        console.log(res.latitude);
                        console.log(res.longitude);
                    }
                })
            }
        },
        mapControlTap(e) {
            console.log(e)
            switch (e.controlId) {
                case 1:
                    this.mapCtx.moveToLocation()
                    break;
            }
        },
    }
})